<?php
if(is_user_logged_in())
{
?>
<style>
.name .comment, .brand_name_pf .comment, .short .comment, .deal_address .comment, .image .comment, .camp_end .comment, .latlng .comment{  
  line-height: 16px;
  text-align: justify;
  width: 390px;
}

.pods_form .leftside, .pods_form .rightside {
float: none !important;
}

.form_1{
position: relative !important;
}

.camp_cat label{
position: absolute; top: 0px; right: 170px;
}

.camp_cat select{
position: absolute; top: 58px; right: 135px;
}

.camp_cat .comment{
line-height: 16px;position: absolute;right: 33px;text-align: justify;top: 25px;width: 300px;
}

.city label{
position: absolute; top: 85px; right: 86px; width: 200px !important;
}

.city .comment{
position: absolute; top: 105px; right: 95px;
}

#pods_form1_city{
position: absolute; top: 130px; right: 0px;
}

.tags label{
position: absolute; top: 300px; right: 172px;
}

.tags .comment{
position: absolute; top: 325px; right: 37px;line-height:16px;width:300px
}

#pods_form1_tags{
position: absolute; top: 360px; right: 137px;
}

.tag_pick label{
position: absolute; top: 385px; right: 172px;
}

#pods_form1_tag_pick{
position: absolute; top: 415px; right: 0px;
}
.terms label{
position: absolute; top: 587px; right: 172px;
}
.terms .comment{
line-height: 16px;position: absolute;right: 35px;top: 615px;width: 300px;
}

#pods_form1_terms{
position: absolute; top: 650px; right: 0px;
}

.terms textarea{
width: 42% !important;
}

.deal_address textarea, .short textarea{
width: 68% !important;
}

.terms textarea{
position: absolute;
right: 0;
top: 634px;
}

.form_1 .pick {
width:42% !important;
}

.add_offer{
  margin: 0px auto;
  background-color: #FFFFFF;
  color: #000000;
  padding: 30px;
  width: 800px;
}

.add_offer label{
  width: 115px;
  margin-right: 50px;
  margin-bottom: 10px;
}

.add_offer input, .add_offer textarea, .add_offer select{
  margin-bottom: 10px;
}

.asteric{
font-weight: bold;
color: red;
font-size: 19px;
}

.blue_text{
color: skyblue;
font-weight: bold;
font-size: 15px;
}
.expires
{
  margin-left: 10px;
}

#ui-datepicker-div{
width: 20% !important;
height: 255px !important;
}

#main{
background: none !important;
}

.login_info{
text-align:center;
color: lightSkyBlue;
}

.login_info h3{
padding: 0px !important;
}

.center_align{
text-align:center;
}

.add_offer h2, .add_offer h3{
padding: 0px;
}

.add_offer h3{
font-style: normal;
font-size: 12px;
color: red;
}

.add_offer h3 a{
color: Lime;
font-weight: bold;
}

.add_offer h3 a:visited{
color: grey;
}

.comment{
color: lightSkyBlue !important;
clear: both;
}

.pods_form .option {
color: black !important;
}
</style>
<div class="add_offer">

<div class="center_align"><h2>Share Local Offers</h2><h3>Please read the <a class="edit" href="<?php echo BUZZR_WP_URL.'/guidelines.php'; ?>">offer guidelines</a> before sharing an offer</h3></div>

<?php
$user_id = get_buzzr_users_pod_id();
$Record = new Pod('deal');
//simplified
$fields = array('name','camp_link'=>array('hidden' => true),'brand_name_pf','short','deal_address', 'image'=>array('input_helper' => 'input_upload_single_photo'),'camp_end'=>array('input_helper' => ''),'camp_start'=>array('hidden' => true),'latlng', 'camp_cat'=>array('input_helper'=>'add_offer_local_cat'),'city','tags','tag_pick','terms','sale'=>array('default' => 'active', 'hidden' =>true),'added_by_user'=>array('default' => $user_id,'input_helper'=>'add-offer-added-by-user','hidden'=>true));
echo $Record->publicForm($fields, 'Add Offer!');
?>
</div>

<script type="text/javascript">
jQuery(document).ready(function($){

$('a.edit').click(function(e) {
        e.preventDefault();
        var $this = $(this);
        var horizontalPadding = 30;
        var verticalPadding = 30;
        $('<iframe id="externalSite" src="' + this.href + '" />').dialog({
            title: ($this.attr('title')) ? $this.attr('title') : 'Offer Guidelines',
            autoOpen: true,
            width: 620,
            height: 380,
            minWidth: 550,
            minHeight: 415, 
            modal: true,
            resizable: true,
            autoResize: true
        }).width(620 - horizontalPadding).height(380 - verticalPadding);            
    });
});
</script>

<?php
}
else{
echo '<style>
.login_info{
text-align:center;
color: lightSkyBlue;
}

.login_info h3{
padding: 0px !important;
}
</style>
<div class="login_info"><h3><a rel="nofollow" href="/wp-login.php" class="simplemodal-login" title="Login to Add Local Offers & Get 500 Points">Please Login to add a Deal!</a></h3></div>';
}
?>
<div class="clear"></div>